In circuit emulation (ICE) has been used by software and hardware developers for a number of years as a development tool to emulate the operation of complex circuit building blocks and permit diagnosis and debugging of hardware and software. Such in circuit emulation is most commonly used to analyze and debug the behavior of complex devices such as microcontrollers and microprocessors that have internal structures that are far too complex to readily model using computer simulation software alone.
FIG. 1 illustrates an exemplary conventional in-circuit emulation arrangement 100 used to model, analyze and debug the operation of a microcontroller device. In this arrangement, a host computer (e.g., a personal computer) 110 is connected to a debug logic 120 which is further connected to a special version of the microcontroller device that has been developed specially for use in emulation. Traditionally, a microcontroller manufacturer would manufacture two versions of any one of its microcontrollers, a special version and a production version. The special version of a microcontroller is only used for the purpose of debugging a microcontroller code, which is eventually loaded in the production version of the same microcontroller.
Debugging operation starts with the host computer 110 loading instructions through debug logic block 120 to the special version of the microcontroller 130 as the instructions are executed. Depending upon the application, this operation may be monitored while the special version of the microcontroller 130 is interconnected with the circuitry that is intended to interface a production version of the microcontroller in the finished product under development. Such interconnection may be via simulation within the host computer 110 or as actual circuitry or some combination thereof. As the circuit is stepped through its operation, the debug logic gathers information about the state of various components of the microcontroller 130 during operation and feeds that information back to the host computer 110 for analysis.
During the course of the analysis, various trace information such as time stamps, register value, data memory content, etc., may be logged in the host computer 110 for analysis and debugging by the designer. Additionally, it is generally the case that various break points can be defined by the designer that cause the program to halt execution at various points in the operation to permit detailed analysis. Other debugging tools may also be provided to enable the user to debug the operation of the circuit.
Typically during the debugging process a designer would prefer to run the microcontroller in as much of a real world situation as possible. Therefore, a special microcontroller is installed in a test circuit, which closely resembles the hardware that is to be controlled by the microcontroller.
In circuit emulation systems such as 100 have a number of disadvantages and limitations. Firstly, an IC manufacturer needs to manufacture two versions of a microcontroller, a special version and a production version. The special version of the microcontroller include a central processing unit (CPU), random access memory (RAM), Read only memory (ROM), flash memory, peripheral functions, a debugging circuit and logic to execute input/output functions. Such a microcontroller with all the elements requires a substantial amount of silicon space in a chip. Silicon space in manufacturing an IC is of premium and care must be taken to optimize the use of silicon space. Secondly, the normal operation of such a microprocessor with debugging logic and memory elements is conducted in a high frequency environment, which in and of itself requires added I/O logic and takes up more silicon space which can be converted to added cost of manufacturing. Thirdly, the cost and time of designing two different chips and also the cost of manufacturing two different versions for all different categories of microcontrollers is prohibitive.
Therefore, a need exists to run the debugging process at high frequency and to minimize the space required by the debugging logic in a microcontroller. Also, a need exist to enhance the efficiency of the input output operation in a microcontroller when a microcontroller need not run at high frequency. Another need exist to improve communication of data between the microcontroller under testing condition and the in circuit emulator when the microcontroller is being debugged. The present invention provides a novel solution to these requirements.